package org.example.business.endpoint;

import lombok.extern.slf4j.Slf4j;
import org.example.business.Events;
import org.example.business.endpoint.http.HttpServer;
import org.example.objevent.event.EventActor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ShutdownActor implements EventActor<Object> {

    @Autowired
    private HttpServer server;

    @Override
    public String getWatchEvent() {
        return Events.Shutdown;

    }

    @Override
    public void act(Object data) {
        server.shutdown();

    }

}
